import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

public class Main {
    public static void main(String[] args) {
        Random random = new Random();

        String[] color = {"红桃","黑桃","梅花","方块"};
        String[] number = {"A","2","3","4","5","6","7","8","9","10","J","Q","K"};
        List<String> list = new ArrayList<>();

        for (String s1 : color) {
            for (String s2 : number) {
                list.add(s1 + s2);
            }
        }
        list.add("大王");
        list.add("小王");

        List<String> A = new ArrayList<>();
        List<String> B = new ArrayList<>();
        List<String> C = new ArrayList<>();

        List[] players = {A,B,C};

        Collections.shuffle(list);

//        for (int i = 0; i < list.size(); i++) {
//            int j = random.nextInt(54);
//            String s = list.get(i);
//            list.set(i,list.get(j));
//            list.set(j,s);
//        }

        for (int i = 0; i < 51; i++) {
            for (int j = 0; j < players.length; j++,i++) {
                players[j].add(list.get(i));
            }
        }

        int[] identity = {0,0,0};

        for (int i = 0; i < players.length; i++) {
            int a = random.nextInt(2);
            if(a==1||i==players.length-1){
                for (int j = 51; j < 54; j++) {
                    players[i].add(list.get(j));
                }
                identity[i]=1;
                break;
            }
        }

        for (int j = 0; j < players.length; j++) {
            if (identity[j]==0) {
                System.out.print("农民" + ":");
            }else{
                System.out.print("地主" + " ");
            }
            for (int i = 0; i < players[j].size(); i++) {
                System.out.print(players[j].get(i) + " ");
            }
            System.out.println();
        }

    }
}